home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / mail / xmailbox.4-s / xmailbox / xmailbox-2.4 / MailboxP.h < prev    next >
C/C++ Source or Header  |  1996-06-30  |  4KB  |  107 lines

  1. /*
  2.  * Copyright (c) 1994-96  Dimitrios P. Bouras and William K. W. Cheung
  3.  * 
  4.  * Permission is hereby granted, free of charge, to any person obtaining a copy
  5.  * of this software and associated documentation files (the "Software"), to deal
  6.  * in the Software without restriction, including without limitation the rights
  7.  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8.  * copies of the Software, and to permit persons to whom the Software is
  9.  * furnished to do so, subject to the following conditions:
  10.  * 
  11.  * The above copyright notice and this permission notice shall be included in
  12.  * all copies or substantial portions of the Software.
  13.  * 
  14.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  17.  * X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  18.  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19.  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20.  * 
  21.  * Except as contained in this notice, the name of the X Consortium shall not be
  22.  * used in advertising or otherwise to promote the sale, use or other dealings
  23.  * in this Software without prior written authorization from the X Consortium.
  24.  * 
  25.  * Derived from the MIT X11R5 xbiff, written by Jim Fulton, which is
  26.  * copyrighted (c) 1988 X Consortium.
  27.  *
  28.  * Mailbox XPM additions-modifications:  Dimitrios P. Bouras
  29.  * Audio support and XPM icon animation: William K. W. Cheung
  30.  *
  31.  */
  32.  
  33.  
  34. #ifndef _Mailbox_XPM_P_h
  35. #define _Mailbox_XPM_P_h
  36.  
  37. #include "Mailbox.h"
  38. #include <X11/Xaw/SimpleP.h>
  39. #include <xpm.h>
  40.  
  41. #ifdef SYSV
  42. #define MAILBOX_DIRECTORY "/usr/mail"
  43. #else
  44. #ifdef SVR4
  45. #define MAILBOX_DIRECTORY "/var/mail"
  46. #else
  47. #define MAILBOX_DIRECTORY "/usr/spool/mail"
  48. #endif
  49. #endif
  50.  
  51. typedef struct {                /* new fields for mailbox widget */
  52.     /* resources */
  53.     int update;                    /* seconds between updates */
  54.     String filename;            /* filename to watch */
  55.     String check_command;        /* command to exec for mail check */
  56.     int volume;                    /* bell volume */
  57.     Boolean once_only;            /* ring bell only once on new mail */
  58.     int mail_animupdate;        /* milliseconds between update */
  59.     Boolean mail_animonce;        /* Once show animation once */
  60.     int mail_numofxpmfile;        /* number of icons for mail animation */
  61.     String mail_tool;            /* mail app when mail in above file */
  62.     String mail_xpmfile;        /* xpm icon when mail in above file */
  63.     String mail_sndfile;        /* xpm sound when mail in above file */
  64.     String mail_sndcomm;        /* play sound command when mail in above file */
  65.     String nomail_xpmfile;        /* and for the case of no mail */
  66.     
  67.     /* local state */
  68.     GC gc;                        /* normal GC to use */
  69.     long last_size;                /* size in bytes of mailboxname */
  70.     XtIntervalId interval_id;    /* time between checks */
  71.     XtIntervalId anim_int_id;    /* time between changing icon */
  72.     int anim_id;                /* current displaying icon */
  73.     int first_trig;                /* Trigger the first time */
  74.     Boolean flag_up;            /* is the flag up? */
  75.     struct _mbimage {
  76.         Pixmap bitmap;            /* depth 1, describing shape */
  77.         Pixmap pixmap;            /* full depth pixmap */
  78.         XpmImage *xpmimg;        /* the xpm image */
  79.         int width, height;        /* geometry of pixmaps */
  80.     } full[MAX_ANIM_IMAGE], empty;
  81.     struct {
  82.         Pixmap mask;
  83.         int x, y;
  84.     } shape_cache;            /* last set of info */
  85. } Mailbox_XPM_Part;
  86.  
  87. typedef struct _Mailbox_XPM_Rec {    /* full instance record */
  88.     CorePart core;
  89.     SimplePart simple;
  90.     Mailbox_XPM_Part mailbox;
  91. } Mailbox_XPM_Rec;
  92.  
  93.  
  94. typedef struct {            /* new fields for mailbox class */
  95.     int dummy;                /* stupid C compiler */
  96. } Mailbox_XPM_ClassPart;
  97.  
  98. typedef struct _Mailbox_XPM_ClassRec {    /* full class record declaration */
  99.     CoreClassPart core_class;
  100.     SimpleClassPart simple_class;
  101.     Mailbox_XPM_ClassPart mailbox_class;
  102. } Mailbox_XPM_ClassRec;
  103.  
  104. extern Mailbox_XPM_ClassRec mailboxClassRec;     /* class pointer */
  105.  
  106. #endif /* _Mailbox_XPM_P_h */
  107.